fix: bundle install scripts in release archives (#504)#1011
Merged
Conversation
Release .tgz archives built by goreleaser only shipped plugin.yaml, the binary, README and LICENSE, but plugin.yaml defines install/update hooks that call install-binary.sh / install-binary.ps1. Extracting a release .tgz and running 'helm plugin install ./diff' therefore failed with 'install-binary.sh: not found'. - .goreleaser.yml: bundle install-binary.sh and install-binary.ps1 in every archive. - install-binary.sh / install-binary.ps1: skip the (now redundant) binary download when the platform binary is already staged in HELM_PLUGIN_DIR during install. Update mode always re-downloads. - release workflow: snapshot-only smoke test asserting every archive bundles plugin.yaml, both install scripts, and the binary. - README: note that extracting a release .tgz and running helm plugin install ./diff now works directly. Fixes #504 Signed-off-by: yxxhero <aiopsclub@163.com>
Windows archives bundle diff/bin/diff.exe (not diff/bin/diff). The core fix is confirmed working: all archives (incl. Windows) now bundle the install scripts and binary. Signed-off-by: yxxhero <aiopsclub@163.com>
The git-clone install path resolves to releases/latest/download/<asset>, which can 404 during a release window when the new release is published but its assets are not fully uploaded yet. curl -sSf under 'set -e' failed immediately with no retry. Add a 5-attempt retry loop with linear backoff (3s,6s,9s,12s) around the curl/wget download in install-binary.sh, and equivalent try/catch retry in install-binary.ps1. This absorbs the release upload window and general transient network errors. The archive-install path is unaffected (it skips the download entirely via the existing guard). Signed-off-by: yxxhero <aiopsclub@163.com>
Reproduces the issue #504 scenario in CI: extracts a snapshot linux archive, runs 'helm plugin install ./diff', asserts the install hook skips the network download (bundled binary already staged) and that 'helm diff version' runs. Prevents regressions in the archive-install path. Signed-off-by: yxxhero <aiopsclub@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Extracting a release
.tgz(e.g.helm-diff-linux-amd64.tgz) and runninghelm plugin install ./difffails:The goreleaser-built archives only shipped
plugin.yaml, the binary,README.mdandLICENSE, butplugin.yamldefines install/update hooks referencinginstall-binary.sh/install-binary.ps1, which were not bundled.Fixes #504
Changes
.goreleaser.yml— bundleinstall-binary.shandinstall-binary.ps1in every archive.install-binary.sh/install-binary.ps1— skip the redundant binary download when the platform binary is already staged inHELM_PLUGIN_DIRduring install (the archive already bundles the correct binary). Update mode (-u) always re-downloads..github/workflows/release.yaml— snapshot-only smoke test that fails if any archive is missingplugin.yaml, the install scripts, or the binary.README.md— document thathelm plugin install ./diffnow works directly from an extracted release.tgz.How install flows behave
helm plugin install https://github.com/databus23/helm-diff(git clone)helm plugin install ./difffrom extracted release.tgzhelm plugin update(-u)Verification
shellcheck install-binary.sh— clean-uno-skip — all passNotes
disttarget rather than the goreleaser pipeline that actually produces releases.HELM_DIFF_BIN_TGZairgap flow from adding airgap install instructions #964 keeps working unchanged.